package org.oslims.server.dao;

import java.io.Serializable;
import java.util.List;

import org.hibernate.Session;

public interface BaseDao<T, ID extends Serializable> {
	
    T findById(ID id, boolean lock);

    List<T> findAll();
    
    List<T> findAllSorted(String fieldName);
    
    List<T> findPaged(int start, int length);
    
    List<T> findByExample(T exampleInstance, String[] excludeProperty);
    
    List<T> findByExample(T exampleInstance);
    
    Integer getEntityCount();
    
    T merge(T entity);
    
    T makePersistent(T entity);

    void makeTransient(T entity);
    
    void setSession(Session session);
    
    Session getSession();
}
